package com.wj1c.push.wechat;

import java.io.Serializable;

public class Token implements Serializable {

    protected String access_token;

    protected int expires_in;

    protected long expires_time;

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public int getExpires_in() {
        return expires_in;
    }

    public void setExpires_in(int expires_in) {
        this.expires_in = expires_in;
    }

    public long getExpires_time() {
        return expires_time;
    }

    public void setExpires_time(long expires_time) {
        this.expires_time = expires_time;
    }

    public boolean isWillExpires(){
        return this.isWillExpires(null);
    }

    public boolean isWillExpires(Long currTime){
        if(currTime == null){
            currTime = System.currentTimeMillis() / 1000;
        }
        return access_token == null || expires_time - currTime < 60;
    }

}